package springcloud.config;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

//@LoadBalancerClients(defaultConfiguration = {MySelfRule.class}) //开启随机查询服务器
@Configuration
public class ApplicationContextConfig {
    @Bean
    @LoadBalanced
    //1@LoadBalanced //赋予RestTemplate负载均衡能力
    public RestTemplate getRrestTemplate(){
        return new RestTemplate();
    }
}
